#ifdef _MAC_H // For ASC support on 68k Macintoshes
struct inVBLRec
{
VBLTask VBL;
long VBLA5;
};
typedef struct inVBLRec inVBLRec;
#endif
struct MADDriverRec
{
long IDType; // IDType = 'MADD' -- READ ONLY --
/**********************/
/** Public variables **/
/**********************/
MADDriverSettings DriverSettings; // Driver SetUp -- READ ONLY --
/** Current music in memory, loaded with RLoadMusic() by example **/
MADSpec *header; // MAD Header -- READ ONLY --
PatData *partition[ MAXPATTERN]; // Patterns -- READ ONLY --
sData *(sample[ MAXINSTRU][ MAXSAMPLE]); // Instruments -- READ ONLY --
/** Drivers variables **/
Channel chan[ MAXTRACK]; // Current driver channels -- READ ONLY --
Boolean musicEnd; // Is music playing finished? -- READ ONLY --
short Tube[ MAXTRACK]; // Used in 'Tracks View' Window - View menu
short PartitionReader; // Current position in pattern (0...64)
short Pat; // Current ID Pattern, see 'Patterns list'
short PL; // Current position in partition, see 'Partition list'
long VolExt[ MAXTRACK]; // Volumes settings for each track, see 'Adaptators' window. from 0 to 64
long VolGlobal; // Global SOFTWARE volume (This is NOT Mac hardware volume!) from 0 to 64
short speed; // Current speed, see speed Effect
short finespeed; // Current finespeed, see speed Effect
short InstruTube[ MAXINSTRU]; // Used in 'Instrument View' Window - View menu
short VExt; // External music speed, see 'Adaptators' window. 80 = normal
short FreqExt; // External music pitch, see 'Adaptators' window. 80 = normal
Boolean Reading; // Reading indicator
short LeftRight[ MAXTRACK]; // Left/Right % for Deluxe Driver
#ifdef _MAC_H
SndChannelPtr MusicChannelPP; // The SndChannelPtr to apply SndDoCommand, etc.
#endif // ONLY available if you are using MAC SoundManager driver
#ifdef _INTEL_H
LPDIRECTSOUND lpDirectSound; // The LPDIRECTSOUND to apply & get informations, etc.
LPDIRECTSOUNDBUFFER lpDirectSoundBuffer, lpSwSamp; // ONLY available if you are using Win95 DirectSound driver
#endif
/** Plugs Import/Export variables **/
PlugInfo *ThePlug; // Pointers on plugs code & infos
short TotalPlug; // no of Plugs in pointer ThePlug
/** Private variables - Not documented **/
/* DO NOT MODIFY OR USE these variables */
long MIN_PITCH, MAX_PITCH;
short smallcounter, trackDiv;
long FREQBASE;
short InstruActif[ MAXINSTRU];
Ptr SysHeapPtr, Vol, IntDataPtr, OscilloWavePtr;
Boolean JumpToNextPattern, endPattern, MADPlay;
long ASCBUFFER;
long BufSize;
long VSYNC, BufCounter, BytesToGenerate;
short vibrato_table[ 64];
short MIDIPortRefNum, gOutNodeRefNum;
short InstuNoOld[ MAXTRACK];
short NoteOld[ MAXTRACK];
short VelocityOld[ MAXTRACK];
Boolean TrackLineReading[ MAXTRACK];
Ptr OverShoot;
long *DASCBuffer;
short *DASCBuffer8;
long mytab[ 12];
long MDelay;
long RDelay;
Ptr ReverbPtr;
#ifdef _MAC_H
SndDoubleBufferHeader TheHeader;
SndChannelPtr pseudoChanAWAC;
inVBLRec VBL;
#endif
};
typedef struct MADDriverRec MADDriverRec;
/******************** ***********************/
/*** EFFECTS ID ***/
/******************** ***********************/
enum {
arpeggioE = 0, // 0x00
downslideE = 1, // 0x01
upslideE = 2, // 0x02
portamentoE = 3, // 0x03
vibratoE = 4, // 0x04
portaslideE = 5, // 0x05
vibratoslideE = 6, // 0x06
nothingE = 7, // 0x07
offsetE = 9, // 0x08
slidevolE = 10, // 0x0A
fastskipE = 11, // 0x0B
volumeE = 12, // 0x0C
skipE = 13, // 0x0D
extendedE = 14, // 0x0E
speedE = 15 // 0x0F
};
/******************** ***********************/
/*** FUNCTIONS ***/
/******************** ***********************/
#ifdef __cplusplus
extern "C" {
#endif
MADDriverRec* MADGetMADDriverPtr(); // Get MADDriver structure pointer.
OSErr MADInitLibrary( char *PlugsFolderName, Boolean SysMemory); // Library initialisation, you have to CALL this function if you want to use other functions & variables
OSErr MADDisposeLibrary( void); // Close Library, close music, close driver, free all memory
void MADGetBestDriver( MADDriverSettings *DriverInitParam); // Found and identify the current Mac sound hardware and fill DriverInitParam
OSErr MADCreateDriver( MADDriverSettings *DriverInitParam); // Music Driver initialization and memory allocation
OSErr MADDisposeDriver(); // Dispose the music driver, use it after RInitMusic()
OSErr MADStartDriver( void); // NEW - Activate the sound generating procedure (interruption)
OSErr MADStopDriver( void); // NEW - DESActivate the sound generating procedure (interruption)
OSErr MADPlayMusic(); // NEW - Read and play current music in memory - Call MADStartInterruption BEFORE
OSErr MADStopMusic(); // NEW - Stop reading current music in memory
OSErr MADReset( void); // Reset the current music at the start position
OSErr MADGetMusicStatus( long *fullTime, long *curTime); // Get informations about music position and duration, IN 1/60th SECS !! NOT IN SECS ANYMORE !!!!!!!
OSErr MADSetMusicStatus( long minV, long maxV, long curV); // Change position of current music, by example MADSetMusicStatus( 0, 100, 50) = go to the middle of the music
OSErr MADSetHardwareVolume( long); // 0...64, Mac HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
long MADGetHardwareVolume(); // Return HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
OSErr MADLoadMusicRsrc( OSType IDName, short IDNo); // MADH ONLY - Load a MAD Rsrc into memory
OSErr MADLoadMusicPtr( Ptr myPtr); // MADH ONLY - Load a MAD Ptr into memory, you can DisposPtr your Ptr after this call
OSErr MADLoadMusicPartition( MADPartition *aPartition); // MADH ONLY - Load a MAD partition into memory
OSErr MADLoadMusicFilePString( char *type, Str255 fName); // Load a music file with plugs
OSErr MADLoadMusicFileCString( char *type, Ptr fName); // Load a music file with plugs
OSErr MADLoadMusicFSpFile( char *type, FSSpec *theSpec); // Load a music file with plugs
OSErr MADMusicIdentifyPString( char *type, Str255 pName); // Identify what kind of music format is pName file.
OSErr MADMusicIdentifyCString( char *type, Ptr cName); // Identify what kind of music format is cName file.
OSErr MADMusicIdentifyFSp( char *type, FSSpec *theSpec); // Identify what kind of music format is theSpec file.
Boolean MADPlugAvailable( char *type); // Is plug 'type' available?
OSErr MADDisposeMusic(void); // Dispose the current music, use it after RLoadMusic(), RLoadMusicRsrc(), RInstallMADF()
void MADChangeTracks( short); // Change current tracks number of the music driver
void MADCleanDriver( MADDriverRec *intDriver); // Clean the driver : stop playing sounds
Cmd* GetMADCommand( short position, // Extract a Command from a PatData structure
short channel,
PatData* aPatData);
OSErr MADPlaySndHandle( Handle sound, // Handle to a 'snd ' handle, by ex: GetResource('snd ', 128);
long chan, // channel ID on which to play sound
long note); // note: 0 to NUMBER_NOTES or 0xFF: play sound at his normal sampleRate Khz
OSErr MADPlaySoundData( Ptr soundPtr, // Sound Pointer to data
long size, // Sound size in bytes
long channel, // channel ID on which to play sound
long note, // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
long amplitude, // 8 or 16 bits
long loopBeg, // loop beginning
long loopSize, // loop size in bytes
unsigned long rate); // sample rate of the sound data, by ex: rate22khz
OSErr MADPlaySoundDataSYNC(Ptr soundPtr, // Sound Pointer to data
long size, // Sound size in bytes
long channel, // channel ID on which to play sound
long note, // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
long amplitude, // 8 or 16 bits
long loopBeg, // loop beginning
long loopSize, // loop size in bytes
unsigned long rate); // sample rate of the sound data, by ex: rate22khz
Ptr MADNewPtr( long size, MADDriverSettings* init);
Ptr MADNewPtrClear( long size, MADDriverSettings* init);